#ifndef OFFLINEFILETRANSFERITEM_H
#define OFFLINEFILETRANSFERITEM_H

#include <QWidget>
#include "../Biz/MsgBusParam/IMFileTransferParam.h"

using namespace wwbiz;

namespace Ui {
    class OfflineFileTransferItem;
}

class OfflineFileTransferItem : public QWidget
{
    Q_OBJECT

public:
    explicit OfflineFileTransferItem(QWidget *parent = 0);
    ~OfflineFileTransferItem();
    void InitFileTransferData(CSFileTransferNotify data);

    void ProcessTransferNotify(CSFileTransferNotify notifydata);

    std::string GetFileName();
    bool IsSender();
    bool IsValid();

signals:
    void offlineNotifyOtherSide(CSFileTransferNotify);
    void transferProcessChanged(int);
    void newactivity();

private slots:
    void OnSaveFile();
    void OnCancel();
    void OnReject();

    void on_btnOpen_clicked();

private:
    Ui::OfflineFileTransferItem *ui;
    void ChangeTransferingProcess(int percent);
    void ChangeTransferEvent(int event);
    void SetTransferErrorInfo(int errcode);

    CSFileTransferNotify  m_saved_data;
    bool m_session_valid;
};

#endif // OFFLINEFILETRANSFERITEM_H
